
Page({
  data: {
    startSwiper: [],
  },
  onLoad() {
    var start = wx.getStorageSync("start");
    if (start !=null && start !="") {
      // 跳转到tabbar页面
      wx.switchTab({
        url: '/pages/homepage/homepage',
      })
    }

    
    this.getSwiper()
  },

  getSwiper() {


    let { startSwiper } = this.data;
    wx.request({
      url: 'https://api.it120.cc/zbt/banner/list',
      success: res => {
        // console.log(res);
        if (res.msg="success") {
          res.data.data.map((v)=>{
            if (v.type=="app") {
              startSwiper.push(v)
            }
          })
        }
        this.setData({
          startSwiper: startSwiper
        })
      },

    })
  },

  btnIndex() {
    wx.switchTab({
      url: '/pages/homepage/homepage',
    })
  },
})


